import Vue from 'vue'
import App from './App.vue'
import routes from "./routes/index"
import VueRouter from 'vue-router';
import { registerMicroApps, start } from "qiankun";

const getActiveRule = (hash) => (location) => location.hash.startsWith(hash);
Vue.config.productionTip = false;
Vue.use(VueRouter);

const router = new VueRouter({
    mode: 'hash',
    routes
})

registerMicroApps([{
    name: "app-vue",
    entry: "//localhost:3001",
    container: "#vue",
    activeRule: getActiveRule("#/app-vue")
}]);

new Vue({
    router,
    render: h => h(App),
}).$mount('#app')

start();
